package com.dandelion.common.domain;

public enum ExprStatusEnum {
    UNKNOWN("未知状态", -1),
    NOT_ARRIVAL("未到货", 0),
    ARRIVAL("已到货", 1),
    PICKED("已提货", 2),
    DELIVERED("已送达", 3),
    RECEIVED("已签收", 4),
    VERIFIED("已核销", 5);

    private String statusName;
    private int value;

    public static final ExprStatusEnum of(Byte value) {
        if (value == null) {
            return UNKNOWN;
        }
        for (ExprStatusEnum status : values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        return UNKNOWN;
    }

    ExprStatusEnum(String statusName, int value) {
        this.statusName = statusName;
        this.value = value;
    }

    public String getStatusName() {
        return statusName;
    }

    public int getValue() {
        return value;
    }

    public byte getByteValue() {
        return (byte) value;
    }
}
